package top.infopub.exception;

/**
 * UserException : 用户自定义异常
 * @author Awoke
 * @version 2018年9月13日
 * @see UserException
 * @since
 */
public class UserException extends RuntimeException {

    private static final long serialVersionUID = 7928003401611048366L;

    /**
     * 异常发生时间
     */
    private long date = System.currentTimeMillis();

    /**
     * errorCode
     */
    private String errorCode;

    public UserException(String msg) {
        this("-1", msg);
    }

    public UserException(String code, String msg) {
        super(msg);
        this.errorCode = code;
    }

    public UserException(Throwable cause) {
        super(cause);
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public long getDate() {
        return date;
    }
}